package cn.jly.spring.boot.cloud.beans;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * @author lanyangji
 * @description 测试联合主键 @IdClass和@Id方式
 * @date 2020/12/9 下午 5:01
 */
@IdClass(UserInfoId.class)
@Entity
@Table(name = "tbl_user_info")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserInfo {
    private Integer age;

    @Id
    private String name;

    @Id
    private String telephone;
}
